#include "sound.h"
#include "board.h"

void Open_Door(void)
{
//		USART_SendStr(UART5,"AT+MQTTPUB=0,\"iot212/lyl/1\",\"{\\\"door\\\":1}\",0,0\r\n");
//		rt_thread_mdelay(1000);

	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x01\xEF");
}

void Close_Door(void)
{

//	USART_SendStr(UART5,"AT+MQTTPUB=0,\"iot212/lyl/1\",\"{\\\"door\\\":0}\",0,0\r\n");
//	
//	rt_thread_mdelay(1000);
	
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x02\xEF");
//	rt_thread_mdelay(1000);
	
}

void Code_Error(void)
{
	
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x03\xEF");
}

void Code_Change_Success(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x04\xEF");
}

void Code_Change_Error(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x05\xEF");
}

void Fire_Warning(void)
{
	USART_SendStr(UART5,"AT+MQTTPUB=0,\"iot212/lyl/1\",\"{\\\"fire\\\":1}\",0,0\r\n");
	rt_thread_mdelay(1000);
	
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x06\xEF");
}

void Facing_the_Camera(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x07\xEF");
}

void Please_Enter_Password(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x08\xEF");
}

void Please_Swipe_Your_Card(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x09\xEF");
}

void Air_Warning(void)
{
		USART_SendStr(UART5,"AT+MQTTPUB=0,\"iot212/lyl/1\",\"{\\\"air\\\":1}\",0,0\r\n");
	
	rt_thread_mdelay(1000);
	
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x10\xEF");
}

void Facial_Input_Successful(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0A\xEF");
}

void Facial_Input_Faild(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0B\xEF");
}

void Facial_Input_in_Progress(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0C\xEF");
}

void Facial_Recognition_Successful(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0D\xEF");
}

void Facial_Recognition_Faild(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0E\xEF");
}

void Card_Swiping_Failure(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x0F\xEF");
}

void Shock_Warning(void)
{
		//USART_SendStr(UART5,"AT+MQTTPUB=0,\"iot212/lyl/1\",\"{\\\"shoke\\\":1}\",0,0\r\n");
	
//	rt_thread_mdelay(1000);
	
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x11\xEF");
}

void Fingerprint_Input_Successful(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x12\xEF");
}

void Fingerprint_Input_Faild(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x13\xEF");
}

void Fingerprint_Input_in_Progress(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x14\xEF");
}

void Fingerprint_Deletion_Successful(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x15\xEF");
}

void Fingerprint_Deletion_Faild(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x16\xEF");
}

void Fingerprint_Verification_Successful(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x17\xEF");
}

void Fingerprint_Verification_Faild(void)
{
	RT_UART4_SendData((u8*)"\x7E\x04\x03\x00\x18\xEF");
}